package us.kg.kotoriforest.springmvc.first.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Kotori rotroutine@163.com
 * @since 2025/2/1
 */
@RestController // 等同于@Controller + @ResponseBody 前后端分离开发建议使用这个注解
public class HelloController {

    @RequestMapping("/hello")
    public String hello() {
        return "Hello ssm! 你好 ssm！";
    }

    @RequestMapping("/*.jpg")
    public String test() {
        return "<h1>这是一张jpg图片</h1>";
    }

    @PostMapping(value = "/test/post", params = {"username=114514", "!password"})
    public String testPost() {
        return "这是一个post请求";
    }
}
